<script lang="ts">
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import { defineComponent, ref, nextTick, provide } from 'vue'

export default defineComponent({
  setup() {
    const isRouterAlive = ref<boolean>(true)
    const reload = () => {
      isRouterAlive.value = false
      nextTick(() => {
        isRouterAlive.value = true
      })
    }
    provide('reload', reload)
    return {
      locale: zhCN,
      reload,
      isRouterAlive
    }
  }
})
</script>

<template>
  <a-config-provider :locale="locale">
    <router-view v-if="isRouterAlive"></router-view>
  </a-config-provider>
</template>

<style scoped></style>
